package org.soenea.doitall.domain.command;

import java.util.List;

import org.dsrg.soenea.domain.command.CommandError;
import org.dsrg.soenea.domain.command.CommandException;
import org.dsrg.soenea.domain.command.impl.Command;
import org.dsrg.soenea.domain.helper.Helper;
import org.soenea.doitall.domain.model.group.*;
import org.soenea.doitall.domain.model.group.mapper.*;

public class BrowseGroupsCommand extends Command {
	public BrowseGroupsCommand(Helper helper) {
		super(helper);
	}

	@Override
	public void setUp() throws CommandException {
		// TODO Auto-generated method stub		
	}

	@Override
	public void process() throws CommandException {
		try {
			List<Group> groups = GroupInputMapper.findAll();
			helper.setRequestAttribute("groups", groups);
    	} catch (Exception e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
    	}
	}

	@Override
	public void tearDown() throws CommandError {
		// TODO Auto-generated method stub
	}
}
